﻿function ClientVoteFunc(TabModuleId)
{
    Max=document.getElementById("divMaxVote_"+TabModuleId).value;
    for(var iIndex=0;iIndex<Max;iIndex++)
    {
        checked=document.getElementById("checkVote_"+TabModuleId+"_"+iIndex).checked;
        if(checked)
        {
            ItemId=document.getElementById("txtVoteId_"+TabModuleId+"_"+iIndex).value;
            Subject=document.getElementById("txtVoteName_"+TabModuleId+"_"+iIndex).innerHTML;
            retValue=SODC.CMPortal.Vote.Vote.IncVoteItem(ItemId).value;
            if(retValue.indexOf("ERROR")!=-1)
            {
                alert(retValue);
                return;
            }
            alert(SODC.CMPortal.Vote.Vote.GetVoteClicked(Subject).value);
            break;
        }
    }
}

function ResultVoteFunc(TabModuleId)
{

    Url = SODC.CMPortal.Vote.Vote.ShowResultForm(TabModuleId).value;
        if(Url.indexOf("ERROR")!=-1)
   {
        alert(Url);
        return;
    }
    window.showModalDialog(Url, null, 'dialogHeight: 300px; dialogWidth: 650px; dialogTop: 10px; dialogLeft: 150px; edge: Raised; center: Yes; help: No; scroll: Yes; status: Yes;');
    //var result = window.showModalDialog("http://cmportal:6969/SODC-vie/ResultVote.aspx", null, 'dialogHeight: 600; dialogWidth: 800px; dialogTop: 10px; dialogLeft: 150px; edge: Raised; center: Yes; help: No; scroll: Yes; status: Yes;');
    FilterFunc();

}
